﻿using System;
using System.Collections.Generic;
using STeaL.Functional;

namespace STeaL.Algorithm {

  public static partial class IListExtensions {
#region for_each
    public static Action<T> for_each<T>(this IList<T> list, int first, int last, Action<T> func) {
      for ( ; first != last; ++first ) {
        func(list[first]);
      }
      return func;
    }

    public static Action<T> for_each<T>(this IList<T> list, Action<T> func) {
      return for_each(list, 0, list.Count, func);
    }

#endregion
  }
}
